<div class="parent">
    <div class="child"></div>
</div>

<style>
    .parent {
      height: 100px;
      background-color: aqua;
    }
    .child {
      width: 100px;
      height: 100px;
      background-color: blueviolet;
    
      position: absolute;
      left: calc(50% - 50px);
    }
</style>